#!/bin/bash
#
# Copyright (C) 2013-2021 Spring Studio
# Copyright (C) 2013-2021 Dou Dongchun <doudongchun@163.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

########### library variables ##########
URI=
GIT=https://github.com/google/libkml.git
COMMIT=
LOCAL=libkml

########### build library ##########

build_arch()
{
  ./autogen.sh

  rm -rf build
  mkdir build
  cd build

  export LIBS="-lstdc++"
  ../configure \
    --prefix=$PREFIX \
    --host=$TARGET \
    --with-sysroot=$SYSROOT \
    --with-expat-include-dir=$PREFIX/include \
    --with-expat-lib-dir=$PREFIX/lib \
    --disable-swig --disable-java --disable-python

  make clean
  make -j4 -s
  make install
}

clear_arch() {
  if [ -d build ]; then
    cd build && make clean && cd -
    rm -rf build
  fi
}

############# forbid modify ###########

. ./tools/do-compile.sh
